package io.zhile.research.intellij.ier.common

import io.zhile.research.intellij.ier.common.EvalRecord.reset
import io.zhile.research.intellij.ier.common.Resetter
import io.zhile.research.intellij.ier.common.EvalRecord
import java.io.FilenameFilter
import io.zhile.research.intellij.ier.common.LicenseFileRecord
import io.zhile.research.intellij.ier.common.NormalFileRecord
import com.intellij.ide.util.PropertiesComponent
import com.intellij.ide.util.PropertiesComponentImpl
import io.zhile.research.intellij.ier.common.PropertyRecord
import io.zhile.research.intellij.ier.common.PreferenceRecord
import io.zhile.research.intellij.ier.helper.ReflectionHelper
import com.intellij.ide.plugins.IdeaPluginDescriptor
import com.intellij.ide.plugins.PluginManager
import io.zhile.research.intellij.ier.helper.NotificationHelper
import com.intellij.openapi.util.SystemInfo
import com.intellij.ide.Prefs
import java.util.prefs.BackingStoreException
import com.intellij.openapi.application.PathManager
import kotlin.Throws
import kotlin.jvm.JvmOverloads
import java.io.FileOutputStream
import java.io.DataInputStream
import java.io.FileInputStream
import java.lang.Exception

class PropertyRecord(val key: String) : EvalRecord {
    private val type = "PROPERTY"
    val value: String?
    @Throws(Exception::class)
    override fun reset() {
        PropertiesComponent.getInstance().unsetValue(key)
    }

    override fun toString(): String {
        return type + ": " + key + " = " + (value ?: "")
    }

    init {
        value = PropertiesComponent.getInstance().getValue(key)
    }
}